package org.minos.edit.controller
{
	import flash.events.Event;
	import flash.filesystem.File;
	import org.ichow.utils.StringUtil;
	import org.minos.edit.controller.manager.FileManager;
	import org.minos.edit.view.components.InfoPane;
	import org.minos.edit.view.InfoPaneMediator;
	import org.minos.edit.view.InitInfoMediator;
	import org.minos.edit.view.TableMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Minos
	 */
	public class SaveFileCommand extends SimpleCommand
	{
		
		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			
			var xml : XML =      <data />;
			//
			xml.appendChild( InfoPaneMediator( facade.retrieveMediator( InfoPaneMediator.NAME ) ).info.getXML() );
			xml.appendChild( InitInfoMediator( facade.retrieveMediator( InitInfoMediator.NAME ) ).initInfo.getXML().appendChild( TableMediator( facade.retrieveMediator( TableMediator.NAME ) ).table.getXML().children() ) );
			
			FileManager.save( null , null , xml );
		}
	
	}

}